<script language="JavaScript" type="text/javascript" src="{$GLOBALS.site_url}/system/ext/jquery/jquery-ui.js"></script>
<script language="JavaScript" type="text/javascript" src="{$GLOBALS.site_url}/system/ext/jquery/jquery.bgiframe.js"></script>
<script language="JavaScript" type="text/javascript" src="{$GLOBALS.site_url}/system/ext/jquery/jquery.form.js"></script>
<script type="text/javascript" language="JavaScript">
{literal}
function checkField( obj, name ) {
    if (obj.val() != "") {
        var options = {
            data: { isajaxrequest: 'true', type: name },
            success: showResponse
        };
        $("#registr-form").ajaxSubmit( options );
    }
    function showResponse(responseText, statusText, xhr, $form) {
        var mes = "";
        switch(responseText) {
            case 'NOT_VALID_EMAIL_FORMAT':
                mes = "{/literal}[[Email format is not valid]]{literal}";
                break;
            case 'NOT_UNIQUE_VALUE':
                mes = "{/literal}[[this value is already used in the system]]{literal}";
                break;
            case 'HAS_BAD_WORDS':
                mes = "{/literal}[[has bad words]]{literal}";
                break;
            case '1':
                mes = "";
                break;
        }
        $("#am_" + name).text(mes);
    }
};
{/literal}
</script>

<h1>[[{$user_group_info.name}]] [[Registration]]</h1>
{* SOCIAL PLUGIN: LOGIN BUTTONs *}
<div class="soc_reg_form">
{module name="social" function="social_plugins"}
</div>
{* / SOCIAL PLUGIN: LOGIN BUTTONs *}
{foreach from=$errors item=error key=field_caption}
	<p class="error">
    	{if $error eq 'EMPTY_VALUE'}
    		{if $field_caption == "Enter code from image"}
            	[[Enter Security code]]
            {else}
    			'[[FormFieldCaptions!{$field_caption}]]' [[is empty]]
    		{/if}
    	{elseif $error eq 'NOT_UNIQUE_VALUE'}
    		'[[FormFieldCaptions!{$field_caption}]]' [[this value is already used in the system]]
    	{elseif $error eq 'NOT_CONFIRMED'}
    		'[[FormFieldCaptions!{$field_caption}]]' [[not confirmed]]
    	{elseif $error eq 'NOT_VALID_ID_VALUE'}
    		[[You can use only alphanumeric characters for]] '{$field_caption}'
    	{elseif $error eq 'NOT_VALID_EMAIL_FORMAT'}
    		[[Email format is not valid]]
    	{elseif $error eq 'NOT_VALID'}
    		{if $field_caption == "Enter code from image"}
            	[[Security code is not valid]]
            {else}
    			'[[FormFieldCaptions!{$field_caption}]]' [[is not valid]]
    		{/if}
		{elseif $error eq 'LOCATION_NOT_EXISTS'}
			<p class="error">'[[FormFieldCaptions!{$field_caption}]]' [[value does not exist in the database]]</p>
		{elseif $error eq 'HAS_BAD_WORDS'}
			'{$field_caption}' [[has bad words]]
		{else}
			[[{$error}]]
    	{/if}
	</p>
{/foreach}
{* for social plugins *}
{if $socialRegistration}
<p>[[You’re almost registered on our site! Please complete the form below to finish the registration.]]</p>
{/if}
{* end of "for social plugins" *}
<br/>[[Fields marked with an asterisk (]]<font color="red">*</font>[[) are mandatory]]<br/>
<form method="post" action="" enctype="multipart/form-data" onsubmit="return checkform();" id="registr-form">
<div id='reg_left'>
<input type="hidden" name="action" value="register" />
{set_token_field}
	{foreach from=$form_fields item=form_field}
		{if $user_group_info.show_mailing_flag==0 && $form_field.id=="sendmail"}
		{else}
			<fieldset>
				<div class="inputName">[[$form_field.caption]]</div>
				<div class="inputReq">&nbsp;{if $form_field.is_required}*{/if}</div>
				<div class="inputField">{input property=$form_field.id}</div>
				{if $form_field.instructions}{assign var="instructionsExist" value="1"}{include file="../classifieds/instructions.tpl" form_field=$form_field}{/if}
			</fieldset>
		{/if}
	{/foreach}
	{if $terms_of_use_check != 0}
		<fieldset>
			<div class="inputName">[[Accept terms of use]]</div>
			<div class="inputReq">*</div>
			<div class="inputField">
				<input type="checkbox" name="terms" {if $smarty.post.terms}checked{/if} id="terms" />
				<a style='cursor:pointer; color: #666666; text-decoration:underline;' onclick="popUpWindow('{$GLOBALS.site_url}/terms-of-use-pop/', 512, 600, '[[Terms of use]]')">[[Read terms of use]]</a>
			</div>
		</fieldset>
	{/if}
		<fieldset>
			<div class="inputName">&nbsp;</div>
			<div class="inputReq">&nbsp;</div>
			<div class="inputField"><input type="hidden" name="user_group_id" value="{$user_group_info.id}" /> <input type="submit" value="[[Register:raw]]" /></div>
		</fieldset>
</div>
<div id='reg_right'>
		{if $user_group_info.id=='JobSeeker'}
		<h2>Job Seekers</h2>
		<ul>
		<li class='one'><strong>Resume posting</strong><br />
		Build up to 5 resumes and 5 distinct cover letters:   Use a web application template, upload any type of file, or upload your LinkedIn data. 
Get creative!  You can also add photos, upload videos, attach files and preview your resume before it gets posted.<br />
		</li>
		<li class='two'><strong>LinkedIn </strong><br />
		Register or login using your LinkedIn account to allow resume auto fill and synchronizing. Our system will let you know if any of your LinkedIn contacts are insiders. <br />
		</li>
		<li class='three'><strong>Confidential Resume</strong><br />
		Choose whether your resume will be visible to all employers, only selected employers, or to all employers except the selected ones.<br />
		</li>
		<li class='five'><strong>Job alerts</strong><br />
		Separate section for creating and managing job alerts. Our system will send new job alerts, based on your selected search criteria, right to your email.<br />
		</li>
		<li class='six'><strong>Resume Clip</strong>   <br />
		On the resume form you will see a section called Resume Clip. Here you will type in a short description about what position you are looking for and some basic information about the experience you have. This clip will be how employers get enticed to look at your full resume.
	    </li>	
		</ul>
		{/if}
		{if $user_group_info.id=='Employer'}
		<h2>Employers</h2>
		<ul>
		<li class='one'><strong>Job posting(s)</strong><br />
		Post your help wanted ads for a minimum of 30 days with no obligation to renew. Upload photos, files or videos to your job posts. Employers can preview the job before posting.<br />
		</li>
		<li class='two'><strong>Resume Browsing </strong><br />
		Browse by Keyword, Job Category , Location.  Take a test drive to view resume clips before you purchase!<br />
		</li>
		<li class='three'><strong>Resume alerts</strong><br />
		System will send new resume alerts based on the selected search criteria to user email. Separate section for creating and managing resume alerts.<br />
		</li>
		<li class='four'><strong>Screening Questionnaire </strong><br />
		Ability for Employers to create questionnaires with passing score and add them to job postings. Job Seekers when applying for such job have to fill up a questionnaire.<br />
		</li>
		<li class='five'><strong>User Sub-Accounts</strong><br />
		Employers can create sub-accounts and set different permissions for each of them.
This feature is useful in a case Employer is a big company or a recruiting agency, and he needs to have several accounts for his HR managers, managed by the main company account.
<br />
		</li>
		<li class='six'><strong>Pricing</strong>   <br />
		Please create an employer account and click on Listings & Services.
	    </li>	
		</ul>
		{/if}
		
		</div>

</form>
{if $instructionsExist}
{literal}
<script type="text/javascript">
	$("document").ready(function() {
		var elem = $(".instruction").prev();
		elem.children().focus(function() {
			$(this).parent().next(".instruction").children(".instr_block").show();
		});
		elem.children().blur(function() {
			$(this).parent().next(".instruction").children(".instr_block").hide();
		});
	});
    CKEDITOR.on('instanceReady', function(e) {
        e.editor.on('focus', function() {
            $("#instruction_"+ e.editor.name).show();
        });
        e.editor.on('blur', function() {
            $("#instruction_"+e.editor.name).hide();
        });
        return;
    });
</script>
{/literal}
{/if}
<script language='JavaScript' type='text/javascript'>
function checkform() {ldelim}

{if $terms_of_use_check != 0}
	if (!document.getElementById('terms').checked) {ldelim}
		alert('[[Read terms of use]]');
		return false;
	{rdelim}
{/if}

	return true;
	
{rdelim}
</script>